<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>src.datastructure.interval_list</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="src-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >ttrq4fleet - Petrina Papazek</th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        <a href="src-module.html">Package&nbsp;src</a> ::
        <a href="src.datastructure-module.html">Package&nbsp;datastructure</a> ::
        Module&nbsp;interval_list
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="src.datastructure.interval_list-pysrc.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<h1 class="epydoc">Source Code for <a href="src.datastructure.interval_list-module.html">Module src.datastructure.interval_list</a></h1>
<pre class="py-src">
<a name="L1"></a><tt class="py-lineno">  1</tt>  <tt class="py-line"><tt class="py-docstring">'''</tt> </tt>
<a name="L2"></a><tt class="py-lineno">  2</tt>  <tt class="py-line"><tt class="py-docstring">Created on Aug 13, 2012</tt> </tt>
<a name="L3"></a><tt class="py-lineno">  3</tt>  <tt class="py-line"><tt class="py-docstring"></tt> </tt>
<a name="L4"></a><tt class="py-lineno">  4</tt>  <tt class="py-line"><tt class="py-docstring">@author: petrina</tt> </tt>
<a name="L5"></a><tt class="py-lineno">  5</tt>  <tt class="py-line"><tt class="py-docstring">'''</tt> </tt>
<a name="L6"></a><tt class="py-lineno">  6</tt>  <tt class="py-line"> </tt>
<a name="L7"></a><tt class="py-lineno">  7</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">logging</tt> </tt>
<a name="L8"></a><tt class="py-lineno">  8</tt>  <tt class="py-line"><tt class="py-keyword">import</tt> <tt class="py-name">datetime</tt> </tt>
<a name="L9"></a><tt class="py-lineno">  9</tt>  <tt class="py-line"><tt class="py-keyword">from</tt> <tt id="link-0" class="py-name" targets="Package src.error=src.error-module.html"><a title="src.error" class="py-name" href="#" onclick="return doclink('link-0', 'error', 'link-0');">error</a></tt><tt class="py-op">.</tt><tt id="link-1" class="py-name" targets="Module src.error.data_exceptions=src.error.data_exceptions-module.html"><a title="src.error.data_exceptions" class="py-name" href="#" onclick="return doclink('link-1', 'data_exceptions', 'link-1');">data_exceptions</a></tt> <tt class="py-keyword">import</tt> <tt id="link-2" class="py-name" targets="Class src.error.data_exceptions.Record_exception=src.error.data_exceptions.Record_exception-class.html"><a title="src.error.data_exceptions.Record_exception" class="py-name" href="#" onclick="return doclink('link-2', 'Record_exception', 'link-2');">Record_exception</a></tt> </tt>
<a name="L10"></a><tt class="py-lineno"> 10</tt>  <tt class="py-line"> </tt>
<a name="L11"></a><tt class="py-lineno"> 11</tt>  <tt class="py-line"> </tt>
<a name="Interval_list"></a><div id="Interval_list-def"><a name="L12"></a><tt class="py-lineno"> 12</tt> <a class="py-toggle" href="#" id="Interval_list-toggle" onclick="return toggle('Interval_list');">-</a><tt class="py-line"><tt class="py-keyword">class</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html">Interval_list</a><tt class="py-op">(</tt><tt class="py-base-class">object</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list-collapsed" style="display:none;" pad="+++" indent="++++"></div><div id="Interval_list-expanded"><a name="L13"></a><tt class="py-lineno"> 13</tt>  <tt class="py-line">    <tt class="py-docstring">'''</tt> </tt>
<a name="L14"></a><tt class="py-lineno"> 14</tt>  <tt class="py-line"><tt class="py-docstring">    List of agg_records measured at a specific time interval.</tt> </tt>
<a name="L15"></a><tt class="py-lineno"> 15</tt>  <tt class="py-line"><tt class="py-docstring">    </tt> </tt>
<a name="L16"></a><tt class="py-lineno"> 16</tt>  <tt class="py-line"><tt class="py-docstring">    Objects of this class are used from the record_list.</tt> </tt>
<a name="L17"></a><tt class="py-lineno"> 17</tt>  <tt class="py-line"><tt class="py-docstring">    '''</tt> </tt>
<a name="L18"></a><tt class="py-lineno"> 18</tt>  <tt class="py-line">     </tt>
<a name="L19"></a><tt class="py-lineno"> 19</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.__init__"></a><div id="Interval_list.__init__-def"><a name="L20"></a><tt class="py-lineno"> 20</tt> <a class="py-toggle" href="#" id="Interval_list.__init__-toggle" onclick="return toggle('Interval_list.__init__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#__init__">__init__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">interval</tt> <tt class="py-op">=</tt> <tt class="py-number">0</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.__init__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.__init__-expanded"><a name="L21"></a><tt class="py-lineno"> 21</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L22"></a><tt class="py-lineno"> 22</tt>  <tt class="py-line"><tt class="py-docstring">        @param interval: time interval (default: 0)</tt> </tt>
<a name="L23"></a><tt class="py-lineno"> 23</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L24"></a><tt class="py-lineno"> 24</tt>  <tt class="py-line">         </tt>
<a name="L25"></a><tt class="py-lineno"> 25</tt>  <tt class="py-line">        <tt class="py-comment"># the internal structure is a dict</tt> </tt>
<a name="L26"></a><tt class="py-lineno"> 26</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L27"></a><tt class="py-lineno"> 27</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-3" class="py-name" targets="Variable src.datastructure.agg_record.Agg_record.interval=src.datastructure.agg_record.Agg_record-class.html#interval,Variable src.datastructure.interval_list.Interval_list.interval=src.datastructure.interval_list.Interval_list-class.html#interval"><a title="src.datastructure.agg_record.Agg_record.interval
src.datastructure.interval_list.Interval_list.interval" class="py-name" href="#" onclick="return doclink('link-3', 'interval', 'link-3');">interval</a></tt> <tt class="py-op">=</tt> <tt id="link-4" class="py-name"><a title="src.datastructure.agg_record.Agg_record.interval
src.datastructure.interval_list.Interval_list.interval" class="py-name" href="#" onclick="return doclink('link-4', 'interval', 'link-3');">interval</a></tt> </tt>
<a name="L28"></a><tt class="py-lineno"> 28</tt>  <tt class="py-line">         </tt>
<a name="L29"></a><tt class="py-lineno"> 29</tt>  <tt class="py-line">        <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">"Interval_list: created new Interval_list"</tt><tt class="py-op">)</tt> </tt>
</div><a name="L30"></a><tt class="py-lineno"> 30</tt>  <tt class="py-line"> </tt>
<a name="L31"></a><tt class="py-lineno"> 31</tt>  <tt class="py-line"> </tt>
<a name="L32"></a><tt class="py-lineno"> 32</tt>  <tt class="py-line">    <tt class="py-comment">#-----------------------getter- and setter-methods-------------------------</tt> </tt>
<a name="L33"></a><tt class="py-lineno"> 33</tt>  <tt class="py-line"> </tt>
<a name="Interval_list.get_interval"></a><div id="Interval_list.get_interval-def"><a name="L34"></a><tt class="py-lineno"> 34</tt> <a class="py-toggle" href="#" id="Interval_list.get_interval-toggle" onclick="return toggle('Interval_list.get_interval');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#get_interval">get_interval</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.get_interval-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.get_interval-expanded"><a name="L35"></a><tt class="py-lineno"> 35</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__interval</tt> </tt>
</div><a name="L36"></a><tt class="py-lineno"> 36</tt>  <tt class="py-line"> </tt>
<a name="L37"></a><tt class="py-lineno"> 37</tt>  <tt class="py-line"> </tt>
<a name="Interval_list.set_interval"></a><div id="Interval_list.set_interval-def"><a name="L38"></a><tt class="py-lineno"> 38</tt> <a class="py-toggle" href="#" id="Interval_list.set_interval-toggle" onclick="return toggle('Interval_list.set_interval');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#set_interval">set_interval</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">value</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.set_interval-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.set_interval-expanded"><a name="L39"></a><tt class="py-lineno"> 39</tt>  <tt class="py-line">        <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__interval</tt> <tt class="py-op">=</tt> <tt class="py-name">value</tt> </tt>
</div><a name="L40"></a><tt class="py-lineno"> 40</tt>  <tt class="py-line"> </tt>
<a name="L41"></a><tt class="py-lineno"> 41</tt>  <tt class="py-line"> </tt>
<a name="Interval_list.del_interval"></a><div id="Interval_list.del_interval-def"><a name="L42"></a><tt class="py-lineno"> 42</tt> <a class="py-toggle" href="#" id="Interval_list.del_interval-toggle" onclick="return toggle('Interval_list.del_interval');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#del_interval">del_interval</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.del_interval-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.del_interval-expanded"><a name="L43"></a><tt class="py-lineno"> 43</tt>  <tt class="py-line">        <tt class="py-keyword">del</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__interval</tt> </tt>
</div><a name="L44"></a><tt class="py-lineno"> 44</tt>  <tt class="py-line"> </tt>
<a name="L45"></a><tt class="py-lineno"> 45</tt>  <tt class="py-line"> </tt>
<a name="Interval_list.get_begintime"></a><div id="Interval_list.get_begintime-def"><a name="L46"></a><tt class="py-lineno"> 46</tt> <a class="py-toggle" href="#" id="Interval_list.get_begintime-toggle" onclick="return toggle('Interval_list.get_begintime');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#get_begintime">get_begintime</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.get_begintime-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.get_begintime-expanded"><a name="L47"></a><tt class="py-lineno"> 47</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L48"></a><tt class="py-lineno"> 48</tt>  <tt class="py-line"><tt class="py-docstring">        searches for and returns the earliest record.</tt> </tt>
<a name="L49"></a><tt class="py-lineno"> 49</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L50"></a><tt class="py-lineno"> 50</tt>  <tt class="py-line"><tt class="py-docstring">        @return: agg_record, if there is no record in the list the method returns None.</tt> </tt>
<a name="L51"></a><tt class="py-lineno"> 51</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L52"></a><tt class="py-lineno"> 52</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">)</tt> <tt class="py-op">&gt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt> </tt>
<a name="L53"></a><tt class="py-lineno"> 53</tt>  <tt class="py-line">            <tt class="py-name">time</tt> <tt class="py-op">=</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">now</tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
<a name="L54"></a><tt class="py-lineno"> 54</tt>  <tt class="py-line">             </tt>
<a name="L55"></a><tt class="py-lineno"> 55</tt>  <tt class="py-line">            <tt class="py-comment"># search for the oldest timestamp</tt> </tt>
<a name="L56"></a><tt class="py-lineno"> 56</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">rec</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">:</tt> </tt>
<a name="L57"></a><tt class="py-lineno"> 57</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">rec</tt><tt class="py-op">.</tt><tt id="link-5" class="py-name" targets="Variable src.datastructure.agg_record.Agg_record.timestamp=src.datastructure.agg_record.Agg_record-class.html#timestamp"><a title="src.datastructure.agg_record.Agg_record.timestamp" class="py-name" href="#" onclick="return doclink('link-5', 'timestamp', 'link-5');">timestamp</a></tt> <tt class="py-op">&lt;</tt> <tt class="py-name">time</tt><tt class="py-op">:</tt> </tt>
<a name="L58"></a><tt class="py-lineno"> 58</tt>  <tt class="py-line">                    <tt class="py-name">time</tt> <tt class="py-op">=</tt><tt class="py-name">rec</tt><tt class="py-op">.</tt><tt id="link-6" class="py-name"><a title="src.datastructure.agg_record.Agg_record.timestamp" class="py-name" href="#" onclick="return doclink('link-6', 'timestamp', 'link-5');">timestamp</a></tt> </tt>
<a name="L59"></a><tt class="py-lineno"> 59</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">time</tt> </tt>
<a name="L60"></a><tt class="py-lineno"> 60</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L61"></a><tt class="py-lineno"> 61</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L62"></a><tt class="py-lineno"> 62</tt>  <tt class="py-line"> </tt>
<a name="L63"></a><tt class="py-lineno"> 63</tt>  <tt class="py-line"> </tt>
<a name="Interval_list.get_endtime"></a><div id="Interval_list.get_endtime-def"><a name="L64"></a><tt class="py-lineno"> 64</tt> <a class="py-toggle" href="#" id="Interval_list.get_endtime-toggle" onclick="return toggle('Interval_list.get_endtime');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#get_endtime">get_endtime</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.get_endtime-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.get_endtime-expanded"><a name="L65"></a><tt class="py-lineno"> 65</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L66"></a><tt class="py-lineno"> 66</tt>  <tt class="py-line"><tt class="py-docstring">        searches for and returns the most recent record.</tt> </tt>
<a name="L67"></a><tt class="py-lineno"> 67</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L68"></a><tt class="py-lineno"> 68</tt>  <tt class="py-line"><tt class="py-docstring">        @return: agg_record, if there is no record in the list the method returns None.</tt> </tt>
<a name="L69"></a><tt class="py-lineno"> 69</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L70"></a><tt class="py-lineno"> 70</tt>  <tt class="py-line">         </tt>
<a name="L71"></a><tt class="py-lineno"> 71</tt>  <tt class="py-line">        <tt class="py-keyword">if</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">)</tt> <tt class="py-op">&gt;</tt> <tt class="py-number">0</tt><tt class="py-op">:</tt>         </tt>
<a name="L72"></a><tt class="py-lineno"> 72</tt>  <tt class="py-line">            <tt class="py-name">time</tt> <tt class="py-op">=</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">datetime</tt><tt class="py-op">(</tt><tt class="py-number">1900</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">,</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L73"></a><tt class="py-lineno"> 73</tt>  <tt class="py-line">             </tt>
<a name="L74"></a><tt class="py-lineno"> 74</tt>  <tt class="py-line">            <tt class="py-comment"># search for the newest timestamp</tt> </tt>
<a name="L75"></a><tt class="py-lineno"> 75</tt>  <tt class="py-line">            <tt class="py-keyword">for</tt> <tt class="py-name">rec</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">:</tt> </tt>
<a name="L76"></a><tt class="py-lineno"> 76</tt>  <tt class="py-line">                <tt class="py-keyword">if</tt> <tt class="py-name">rec</tt><tt class="py-op">.</tt><tt id="link-7" class="py-name"><a title="src.datastructure.agg_record.Agg_record.timestamp" class="py-name" href="#" onclick="return doclink('link-7', 'timestamp', 'link-5');">timestamp</a></tt> <tt class="py-op">&gt;</tt> <tt class="py-name">time</tt><tt class="py-op">:</tt> </tt>
<a name="L77"></a><tt class="py-lineno"> 77</tt>  <tt class="py-line">                    <tt class="py-name">time</tt> <tt class="py-op">=</tt><tt class="py-name">rec</tt><tt class="py-op">.</tt><tt id="link-8" class="py-name"><a title="src.datastructure.agg_record.Agg_record.timestamp" class="py-name" href="#" onclick="return doclink('link-8', 'timestamp', 'link-5');">timestamp</a></tt> </tt>
<a name="L78"></a><tt class="py-lineno"> 78</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">time</tt> </tt>
<a name="L79"></a><tt class="py-lineno"> 79</tt>  <tt class="py-line">        <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L80"></a><tt class="py-lineno"> 80</tt>  <tt class="py-line">            <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L81"></a><tt class="py-lineno"> 81</tt>  <tt class="py-line"> </tt>
<a name="L82"></a><tt class="py-lineno"> 82</tt>  <tt class="py-line">         </tt>
<a name="L83"></a><tt class="py-lineno"> 83</tt>  <tt class="py-line">    <tt class="py-comment">#----------------------public methods of the class-------------------------</tt> </tt>
<a name="L84"></a><tt class="py-lineno"> 84</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.__iter__"></a><div id="Interval_list.__iter__-def"><a name="L85"></a><tt class="py-lineno"> 85</tt> <a class="py-toggle" href="#" id="Interval_list.__iter__-toggle" onclick="return toggle('Interval_list.__iter__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#__iter__">__iter__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.__iter__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.__iter__-expanded"><a name="L86"></a><tt class="py-lineno"> 86</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">.</tt><tt id="link-9" class="py-name" targets="Method src.datastructure.interval_list.Interval_list.__iter__()=src.datastructure.interval_list.Interval_list-class.html#__iter__,Method src.datastructure.linkset.Linkset.__iter__()=src.datastructure.linkset.Linkset-class.html#__iter__,Method src.datastructure.record_list.Record_list.__iter__()=src.datastructure.record_list.Record_list-class.html#__iter__,Method src.processing.indicatorset.Indicatorset.__iter__()=src.processing.indicatorset.Indicatorset-class.html#__iter__"><a title="src.datastructure.interval_list.Interval_list.__iter__
src.datastructure.linkset.Linkset.__iter__
src.datastructure.record_list.Record_list.__iter__
src.processing.indicatorset.Indicatorset.__iter__" class="py-name" href="#" onclick="return doclink('link-9', '__iter__', 'link-9');">__iter__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L87"></a><tt class="py-lineno"> 87</tt>  <tt class="py-line">     </tt>
<a name="L88"></a><tt class="py-lineno"> 88</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.next"></a><div id="Interval_list.next-def"><a name="L89"></a><tt class="py-lineno"> 89</tt> <a class="py-toggle" href="#" id="Interval_list.next-toggle" onclick="return toggle('Interval_list.next');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#next">next</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.next-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.next-expanded"><a name="L90"></a><tt class="py-lineno"> 90</tt>  <tt class="py-line">        <tt class="py-keyword">pass</tt> </tt>
</div><a name="L91"></a><tt class="py-lineno"> 91</tt>  <tt class="py-line">     </tt>
<a name="L92"></a><tt class="py-lineno"> 92</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.__getitem__"></a><div id="Interval_list.__getitem__-def"><a name="L93"></a><tt class="py-lineno"> 93</tt> <a class="py-toggle" href="#" id="Interval_list.__getitem__-toggle" onclick="return toggle('Interval_list.__getitem__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#__getitem__">__getitem__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">key</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.__getitem__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.__getitem__-expanded"><a name="L94"></a><tt class="py-lineno"> 94</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">[</tt><tt class="py-name">key</tt><tt class="py-op">]</tt> </tt>
</div><a name="L95"></a><tt class="py-lineno"> 95</tt>  <tt class="py-line">     </tt>
<a name="L96"></a><tt class="py-lineno"> 96</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.items"></a><div id="Interval_list.items-def"><a name="L97"></a><tt class="py-lineno"> 97</tt> <a class="py-toggle" href="#" id="Interval_list.items-toggle" onclick="return toggle('Interval_list.items');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#items">items</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.items-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.items-expanded"><a name="L98"></a><tt class="py-lineno"> 98</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">.</tt><tt id="link-10" class="py-name" targets="Method src.datastructure.interval_list.Interval_list.items()=src.datastructure.interval_list.Interval_list-class.html#items,Method src.datastructure.record_list.Record_list.items()=src.datastructure.record_list.Record_list-class.html#items"><a title="src.datastructure.interval_list.Interval_list.items
src.datastructure.record_list.Record_list.items" class="py-name" href="#" onclick="return doclink('link-10', 'items', 'link-10');">items</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt> </tt>
</div><a name="L99"></a><tt class="py-lineno"> 99</tt>  <tt class="py-line">     </tt>
<a name="L100"></a><tt class="py-lineno">100</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.__len__"></a><div id="Interval_list.__len__-def"><a name="L101"></a><tt class="py-lineno">101</tt> <a class="py-toggle" href="#" id="Interval_list.__len__-toggle" onclick="return toggle('Interval_list.__len__');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#__len__">__len__</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.__len__-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.__len__-expanded"><a name="L102"></a><tt class="py-lineno">102</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">len</tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">)</tt> </tt>
</div><a name="L103"></a><tt class="py-lineno">103</tt>  <tt class="py-line">    </tt>
<a name="L104"></a><tt class="py-lineno">104</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.plot"></a><div id="Interval_list.plot-def"><a name="L105"></a><tt class="py-lineno">105</tt> <a class="py-toggle" href="#" id="Interval_list.plot-toggle" onclick="return toggle('Interval_list.plot');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#plot">plot</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">plotobject</tt><tt class="py-op">,</tt> <tt class="py-param">attribute</tt> <tt class="py-op">=</tt> <tt class="py-string">"speed"</tt><tt class="py-op">,</tt> <tt class="py-param">color</tt> <tt class="py-op">=</tt> <tt class="py-string">'blue'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.plot-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.plot-expanded"><a name="L106"></a><tt class="py-lineno">106</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L107"></a><tt class="py-lineno">107</tt>  <tt class="py-line"><tt class="py-docstring">        plots the records of the list into a given plot (as points with '+' as marker).</tt> </tt>
<a name="L108"></a><tt class="py-lineno">108</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L109"></a><tt class="py-lineno">109</tt>  <tt class="py-line"><tt class="py-docstring">        The method does not initialize a new figure.</tt> </tt>
<a name="L110"></a><tt class="py-lineno">110</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L111"></a><tt class="py-lineno">111</tt>  <tt class="py-line"><tt class="py-docstring">        @param plotobject: object that offers plotting features (e.g. Plot)</tt> </tt>
<a name="L112"></a><tt class="py-lineno">112</tt>  <tt class="py-line"><tt class="py-docstring">        @param attribute: attribute that shall be plotted such as speed or travel time (default: speed)</tt> </tt>
<a name="L113"></a><tt class="py-lineno">113</tt>  <tt class="py-line"><tt class="py-docstring">        @param color: plotting color (default: blue)  </tt> </tt>
<a name="L114"></a><tt class="py-lineno">114</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L115"></a><tt class="py-lineno">115</tt>  <tt class="py-line">         </tt>
<a name="L116"></a><tt class="py-lineno">116</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">rec</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">:</tt> </tt>
<a name="L117"></a><tt class="py-lineno">117</tt>  <tt class="py-line">                <tt class="py-name">plotobject</tt><tt class="py-op">.</tt><tt id="link-11" class="py-name" targets="Method src.datastructure.interval_list.Interval_list.plot()=src.datastructure.interval_list.Interval_list-class.html#plot,Method src.datastructure.link.Link.plot()=src.datastructure.link.Link-class.html#plot,Method src.datastructure.linkset.Linkset.plot()=src.datastructure.linkset.Linkset-class.html#plot,Method src.datastructure.record_list.Record_list.plot()=src.datastructure.record_list.Record_list-class.html#plot,Module src.output.plot=src.output.plot-module.html,Method src.output.plot.Plot.plot()=src.output.plot.Plot-class.html#plot,Method src.processing.indicator.Indicator.plot()=src.processing.indicator.Indicator-class.html#plot,Method src.processing.network_completeness.Network_completeness.plot()=src.processing.network_completeness.Network_completeness-class.html#plot,Method src.processing.planning_time.Planning_time.plot()=src.processing.planning_time.Planning_time-class.html#plot,Method src.processing.total_correlation_coefficient.Total_correlation_coefficient.plot()=src.processing.total_correlation_coefficient.Total_correlation_coefficient-class.html#plot,Method src.processing.total_mean_error.Total_mean_error.plot()=src.processing.total_mean_error.Total_mean_error-class.html#plot,Method src.processing.total_mean_squared_error.Total_mean_squared_error.plot()=src.processing.total_mean_squared_error.Total_mean_squared_error-class.html#plot"><a title="src.datastructure.interval_list.Interval_list.plot
src.datastructure.link.Link.plot
src.datastructure.linkset.Linkset.plot
src.datastructure.record_list.Record_list.plot
src.output.plot
src.output.plot.Plot.plot
src.processing.indicator.Indicator.plot
src.processing.network_completeness.Network_completeness.plot
src.processing.planning_time.Planning_time.plot
src.processing.total_correlation_coefficient.Total_correlation_coefficient.plot
src.processing.total_mean_error.Total_mean_error.plot
src.processing.total_mean_squared_error.Total_mean_squared_error.plot" class="py-name" href="#" onclick="return doclink('link-11', 'plot', 'link-11');">plot</a></tt><tt class="py-op">(</tt><tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__interval</tt><tt class="py-op">,</tt>  </tt>
<a name="L118"></a><tt class="py-lineno">118</tt>  <tt class="py-line">                                <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">rec</tt><tt class="py-op">,</tt> <tt class="py-name">attribute</tt><tt class="py-op">)</tt><tt class="py-op">,</tt>  </tt>
<a name="L119"></a><tt class="py-lineno">119</tt>  <tt class="py-line">                                <tt class="py-name">col</tt> <tt class="py-op">=</tt> <tt class="py-name">color</tt><tt class="py-op">,</tt>  </tt>
<a name="L120"></a><tt class="py-lineno">120</tt>  <tt class="py-line">                                <tt class="py-name">mark</tt><tt class="py-op">=</tt><tt class="py-string">'+'</tt><tt class="py-op">,</tt>  </tt>
<a name="L121"></a><tt class="py-lineno">121</tt>  <tt class="py-line">                                <tt class="py-name">markersize</tt> <tt class="py-op">=</tt> <tt class="py-number">4</tt><tt class="py-op">)</tt> </tt>
</div><a name="L122"></a><tt class="py-lineno">122</tt>  <tt class="py-line">         </tt>
<a name="L123"></a><tt class="py-lineno">123</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.add_record"></a><div id="Interval_list.add_record-def"><a name="L124"></a><tt class="py-lineno">124</tt> <a class="py-toggle" href="#" id="Interval_list.add_record-toggle" onclick="return toggle('Interval_list.add_record');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#add_record">add_record</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">record</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.add_record-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.add_record-expanded"><a name="L125"></a><tt class="py-lineno">125</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L126"></a><tt class="py-lineno">126</tt>  <tt class="py-line"><tt class="py-docstring">        This method adds a Link-record-object to the record_list. </tt> </tt>
<a name="L127"></a><tt class="py-lineno">127</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L128"></a><tt class="py-lineno">128</tt>  <tt class="py-line"><tt class="py-docstring">        Therefore the record shall be of the type agg_record.</tt> </tt>
<a name="L129"></a><tt class="py-lineno">129</tt>  <tt class="py-line"><tt class="py-docstring">        The record-object must have an interval-attribute in order </tt> </tt>
<a name="L130"></a><tt class="py-lineno">130</tt>  <tt class="py-line"><tt class="py-docstring">        to check if they can be added to this list. </tt> </tt>
<a name="L131"></a><tt class="py-lineno">131</tt>  <tt class="py-line"><tt class="py-docstring">        The list only takes records of one specific interval.</tt> </tt>
<a name="L132"></a><tt class="py-lineno">132</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L133"></a><tt class="py-lineno">133</tt>  <tt class="py-line">         </tt>
<a name="L134"></a><tt class="py-lineno">134</tt>  <tt class="py-line">        <tt class="py-keyword">try</tt><tt class="py-op">:</tt> </tt>
<a name="L135"></a><tt class="py-lineno">135</tt>  <tt class="py-line">             </tt>
<a name="L136"></a><tt class="py-lineno">136</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">record</tt><tt class="py-op">.</tt><tt id="link-12" class="py-name"><a title="src.datastructure.agg_record.Agg_record.interval
src.datastructure.interval_list.Interval_list.interval" class="py-name" href="#" onclick="return doclink('link-12', 'interval', 'link-3');">interval</a></tt> <tt class="py-op">==</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">__interval</tt><tt class="py-op">:</tt> </tt>
<a name="L137"></a><tt class="py-lineno">137</tt>  <tt class="py-line">                <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">record</tt><tt class="py-op">)</tt> </tt>
<a name="L138"></a><tt class="py-lineno">138</tt>  <tt class="py-line">                <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">"Interval_list: new record was added to the interval sorted Record_list "</tt> <tt class="py-op">+</tt> <tt class="py-name">record</tt><tt class="py-op">.</tt><tt id="link-13" class="py-name" targets="Method src.datastructure.agg_record.Agg_record.__str__()=src.datastructure.agg_record.Agg_record-class.html#__str__,Method src.datastructure.link.Link.__str__()=src.datastructure.link.Link-class.html#__str__,Method src.error.data_exceptions.Data_exception.__str__()=src.error.data_exceptions.Data_exception-class.html#__str__,Method src.error.exceptions.Config_exception.__str__()=src.error.exceptions.Config_exception-class.html#__str__,Method src.error.exceptions.Import_exception.__str__()=src.error.exceptions.Import_exception-class.html#__str__,Method src.error.exceptions.Indicator_exception.__str__()=src.error.exceptions.Indicator_exception-class.html#__str__,Method src.error.output_exceptions.Output_exception.__str__()=src.error.output_exceptions.Output_exception-class.html#__str__"><a title="src.datastructure.agg_record.Agg_record.__str__
src.datastructure.link.Link.__str__
src.error.data_exceptions.Data_exception.__str__
src.error.exceptions.Config_exception.__str__
src.error.exceptions.Import_exception.__str__
src.error.exceptions.Indicator_exception.__str__
src.error.output_exceptions.Output_exception.__str__" class="py-name" href="#" onclick="return doclink('link-13', '__str__', 'link-13');">__str__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L139"></a><tt class="py-lineno">139</tt>  <tt class="py-line">            <tt class="py-keyword">else</tt><tt class="py-op">:</tt> </tt>
<a name="L140"></a><tt class="py-lineno">140</tt>  <tt class="py-line">                <tt class="py-comment"># the error is ignored</tt> </tt>
<a name="L141"></a><tt class="py-lineno">141</tt>  <tt class="py-line">                <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt id="link-14" class="py-name"><a title="src.error" class="py-name" href="#" onclick="return doclink('link-14', 'error', 'link-0');">error</a></tt><tt class="py-op">(</tt><tt class="py-string">"Interval_list: cannot add the given object to the Record_list because it has the wrong time interval: "</tt> <tt class="py-op">+</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">record</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L142"></a><tt class="py-lineno">142</tt>  <tt class="py-line">                <tt class="py-keyword">raise</tt> <tt id="link-15" class="py-name"><a title="src.error.data_exceptions.Record_exception" class="py-name" href="#" onclick="return doclink('link-15', 'Record_exception', 'link-2');">Record_exception</a></tt><tt class="py-op">(</tt><tt class="py-string">"cannot add the given object to the Record_list"</tt><tt class="py-op">)</tt> </tt>
<a name="L143"></a><tt class="py-lineno">143</tt>  <tt class="py-line">        <tt class="py-keyword">except</tt><tt class="py-op">:</tt> </tt>
<a name="L144"></a><tt class="py-lineno">144</tt>  <tt class="py-line">            <tt class="py-comment"># obviously no record-instance, the error is ignored</tt> </tt>
<a name="L145"></a><tt class="py-lineno">145</tt>  <tt class="py-line">            <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt id="link-16" class="py-name"><a title="src.error" class="py-name" href="#" onclick="return doclink('link-16', 'error', 'link-0');">error</a></tt><tt class="py-op">(</tt><tt class="py-string">"Interval_list: cannot add the given object to the Record_list: "</tt> <tt class="py-op">+</tt> <tt class="py-name">str</tt><tt class="py-op">(</tt><tt class="py-name">record</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L146"></a><tt class="py-lineno">146</tt>  <tt class="py-line">            <tt class="py-keyword">raise</tt> <tt id="link-17" class="py-name"><a title="src.error.data_exceptions.Record_exception" class="py-name" href="#" onclick="return doclink('link-17', 'Record_exception', 'link-2');">Record_exception</a></tt><tt class="py-op">(</tt><tt class="py-string">"cannot add the given object to the Record_list"</tt><tt class="py-op">)</tt> </tt>
</div><a name="L147"></a><tt class="py-lineno">147</tt>  <tt class="py-line">     </tt>
<a name="L148"></a><tt class="py-lineno">148</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.search_data"></a><div id="Interval_list.search_data-def"><a name="L149"></a><tt class="py-lineno">149</tt> <a class="py-toggle" href="#" id="Interval_list.search_data-toggle" onclick="return toggle('Interval_list.search_data');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#search_data">search_data</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">date</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.search_data-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.search_data-expanded"><a name="L150"></a><tt class="py-lineno">150</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L151"></a><tt class="py-lineno">151</tt>  <tt class="py-line"><tt class="py-docstring">        searches the list for data on one specific day.</tt> </tt>
<a name="L152"></a><tt class="py-lineno">152</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L153"></a><tt class="py-lineno">153</tt>  <tt class="py-line"><tt class="py-docstring">        The method returns the first found value. Multiple values are not supposed to be in the list</tt> </tt>
<a name="L154"></a><tt class="py-lineno">154</tt>  <tt class="py-line"><tt class="py-docstring">        because agg_records are already aggregated. </tt> </tt>
<a name="L155"></a><tt class="py-lineno">155</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L156"></a><tt class="py-lineno">156</tt>  <tt class="py-line"><tt class="py-docstring">        @param date: date-object for searching </tt> </tt>
<a name="L157"></a><tt class="py-lineno">157</tt>  <tt class="py-line"><tt class="py-docstring">        @return: found record or None</tt> </tt>
<a name="L158"></a><tt class="py-lineno">158</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L159"></a><tt class="py-lineno">159</tt>  <tt class="py-line">         </tt>
<a name="L160"></a><tt class="py-lineno">160</tt>  <tt class="py-line">        <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">"Interval_list: searching for data on this date "</tt> <tt class="py-op">+</tt> <tt class="py-name">date</tt><tt class="py-op">.</tt><tt id="link-18" class="py-name"><a title="src.datastructure.agg_record.Agg_record.__str__
src.datastructure.link.Link.__str__
src.error.data_exceptions.Data_exception.__str__
src.error.exceptions.Config_exception.__str__
src.error.exceptions.Import_exception.__str__
src.error.exceptions.Indicator_exception.__str__
src.error.output_exceptions.Output_exception.__str__" class="py-name" href="#" onclick="return doclink('link-18', '__str__', 'link-13');">__str__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L161"></a><tt class="py-lineno">161</tt>  <tt class="py-line"> </tt>
<a name="L162"></a><tt class="py-lineno">162</tt>  <tt class="py-line">        <tt class="py-keyword">for</tt> <tt class="py-name">rec</tt> <tt class="py-keyword">in</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt class="py-name">_recordlist</tt><tt class="py-op">:</tt> </tt>
<a name="L163"></a><tt class="py-lineno">163</tt>  <tt class="py-line">            <tt class="py-keyword">if</tt> <tt class="py-name">rec</tt><tt class="py-op">.</tt><tt id="link-19" class="py-name"><a title="src.datastructure.agg_record.Agg_record.timestamp" class="py-name" href="#" onclick="return doclink('link-19', 'timestamp', 'link-5');">timestamp</a></tt><tt class="py-op">.</tt><tt class="py-name">day</tt> <tt class="py-op">==</tt> <tt class="py-name">date</tt><tt class="py-op">.</tt><tt class="py-name">day</tt> <tt class="py-keyword">and</tt> <tt class="py-name">rec</tt><tt class="py-op">.</tt><tt id="link-20" class="py-name"><a title="src.datastructure.agg_record.Agg_record.timestamp" class="py-name" href="#" onclick="return doclink('link-20', 'timestamp', 'link-5');">timestamp</a></tt><tt class="py-op">.</tt><tt class="py-name">year</tt> <tt class="py-op">==</tt> <tt class="py-name">date</tt><tt class="py-op">.</tt><tt class="py-name">year</tt><tt class="py-op">:</tt> </tt>
<a name="L164"></a><tt class="py-lineno">164</tt>  <tt class="py-line">                <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">"Interval_list: found day data "</tt> <tt class="py-op">+</tt> <tt class="py-name">rec</tt><tt class="py-op">.</tt><tt id="link-21" class="py-name"><a title="src.datastructure.agg_record.Agg_record.__str__
src.datastructure.link.Link.__str__
src.error.data_exceptions.Data_exception.__str__
src.error.exceptions.Config_exception.__str__
src.error.exceptions.Import_exception.__str__
src.error.exceptions.Indicator_exception.__str__
src.error.output_exceptions.Output_exception.__str__" class="py-name" href="#" onclick="return doclink('link-21', '__str__', 'link-13');">__str__</a></tt><tt class="py-op">(</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L165"></a><tt class="py-lineno">165</tt>  <tt class="py-line">                <tt class="py-keyword">return</tt> <tt class="py-name">rec</tt> </tt>
<a name="L166"></a><tt class="py-lineno">166</tt>  <tt class="py-line">         </tt>
<a name="L167"></a><tt class="py-lineno">167</tt>  <tt class="py-line">        <tt class="py-name">logging</tt><tt class="py-op">.</tt><tt class="py-name">debug</tt><tt class="py-op">(</tt><tt class="py-string">"Interval_list: cannot find any  data on this day -- returning NONE :("</tt><tt class="py-op">)</tt> </tt>
<a name="L168"></a><tt class="py-lineno">168</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">None</tt> </tt>
</div><a name="L169"></a><tt class="py-lineno">169</tt>  <tt class="py-line">     </tt>
<a name="L170"></a><tt class="py-lineno">170</tt>  <tt class="py-line">     </tt>
<a name="Interval_list.create_value_list"></a><div id="Interval_list.create_value_list-def"><a name="L171"></a><tt class="py-lineno">171</tt> <a class="py-toggle" href="#" id="Interval_list.create_value_list-toggle" onclick="return toggle('Interval_list.create_value_list');">-</a><tt class="py-line">    <tt class="py-keyword">def</tt> <a class="py-def-name" href="src.datastructure.interval_list.Interval_list-class.html#create_value_list">create_value_list</a><tt class="py-op">(</tt><tt class="py-param">self</tt><tt class="py-op">,</tt> <tt class="py-param">starttime</tt><tt class="py-op">,</tt> <tt class="py-param">endtime</tt><tt class="py-op">,</tt> <tt class="py-param">attribute</tt> <tt class="py-op">=</tt> <tt class="py-string">'speed'</tt><tt class="py-op">)</tt><tt class="py-op">:</tt> </tt>
</div><div id="Interval_list.create_value_list-collapsed" style="display:none;" pad="+++" indent="++++++++"></div><div id="Interval_list.create_value_list-expanded"><a name="L172"></a><tt class="py-lineno">172</tt>  <tt class="py-line">        <tt class="py-docstring">'''</tt> </tt>
<a name="L173"></a><tt class="py-lineno">173</tt>  <tt class="py-line"><tt class="py-docstring">        builds a list of data from the given interval-list and attribute between the star- and endtime with the length of n days.</tt> </tt>
<a name="L174"></a><tt class="py-lineno">174</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L175"></a><tt class="py-lineno">175</tt>  <tt class="py-line"><tt class="py-docstring">        If a day has no data, the value will be set None. Therefore several</tt> </tt>
<a name="L176"></a><tt class="py-lineno">176</tt>  <tt class="py-line"><tt class="py-docstring">        lists can be compared, so that the same days are compared.</tt> </tt>
<a name="L177"></a><tt class="py-lineno">177</tt>  <tt class="py-line"><tt class="py-docstring">        Otherwise lists of reference data and regular data might be of different lengths</tt> </tt>
<a name="L178"></a><tt class="py-lineno">178</tt>  <tt class="py-line"><tt class="py-docstring">        (because of missing value) and useless for comparing them by index.</tt> </tt>
<a name="L179"></a><tt class="py-lineno">179</tt>  <tt class="py-line"><tt class="py-docstring">        </tt> </tt>
<a name="L180"></a><tt class="py-lineno">180</tt>  <tt class="py-line"><tt class="py-docstring">        @param starttime: earliest date (date-object)</tt> </tt>
<a name="L181"></a><tt class="py-lineno">181</tt>  <tt class="py-line"><tt class="py-docstring">        @param endtime: most recent date (date-object)</tt> </tt>
<a name="L182"></a><tt class="py-lineno">182</tt>  <tt class="py-line"><tt class="py-docstring">        @param attribute: attribute of the Agg_record, which is added to the list</tt> </tt>
<a name="L183"></a><tt class="py-lineno">183</tt>  <tt class="py-line"><tt class="py-docstring">        @return: list of the attribute values for every day in that time interval/Interval_list</tt> </tt>
<a name="L184"></a><tt class="py-lineno">184</tt>  <tt class="py-line"><tt class="py-docstring">        '''</tt> </tt>
<a name="L185"></a><tt class="py-lineno">185</tt>  <tt class="py-line">         </tt>
<a name="L186"></a><tt class="py-lineno">186</tt>  <tt class="py-line">        <tt class="py-comment"># fill the data into this (usually it contains numeric values, no complex objects)</tt> </tt>
<a name="L187"></a><tt class="py-lineno">187</tt>  <tt class="py-line">        <tt class="py-name">new_data</tt> <tt class="py-op">=</tt> <tt class="py-op">[</tt><tt class="py-op">]</tt> </tt>
<a name="L188"></a><tt class="py-lineno">188</tt>  <tt class="py-line">         </tt>
<a name="L189"></a><tt class="py-lineno">189</tt>  <tt class="py-line">        <tt class="py-name">date</tt> <tt class="py-op">=</tt> <tt class="py-name">starttime</tt> </tt>
<a name="L190"></a><tt class="py-lineno">190</tt>  <tt class="py-line">        <tt class="py-comment"># for every day</tt> </tt>
<a name="L191"></a><tt class="py-lineno">191</tt>  <tt class="py-line">        <tt class="py-keyword">while</tt> <tt class="py-name">date</tt> <tt class="py-op">&lt;=</tt> <tt id="link-22" class="py-name" targets="Variable src.datastructure.interval_list.Interval_list.endtime=src.datastructure.interval_list.Interval_list-class.html#endtime,Variable src.datastructure.linkset.Linkset.endtime=src.datastructure.linkset.Linkset-class.html#endtime,Variable src.datastructure.record_list.Record_list.endtime=src.datastructure.record_list.Record_list-class.html#endtime"><a title="src.datastructure.interval_list.Interval_list.endtime
src.datastructure.linkset.Linkset.endtime
src.datastructure.record_list.Record_list.endtime" class="py-name" href="#" onclick="return doclink('link-22', 'endtime', 'link-22');">endtime</a></tt><tt class="py-op">:</tt>  </tt>
<a name="L192"></a><tt class="py-lineno">192</tt>  <tt class="py-line">            <tt class="py-comment"># get the value or append None (as place holder for the missing value)</tt> </tt>
<a name="L193"></a><tt class="py-lineno">193</tt>  <tt class="py-line">            <tt class="py-name">rec</tt> <tt class="py-op">=</tt> <tt class="py-name">self</tt><tt class="py-op">.</tt><tt id="link-23" class="py-name" targets="Method src.datastructure.interval_list.Interval_list.search_data()=src.datastructure.interval_list.Interval_list-class.html#search_data"><a title="src.datastructure.interval_list.Interval_list.search_data" class="py-name" href="#" onclick="return doclink('link-23', 'search_data', 'link-23');">search_data</a></tt><tt class="py-op">(</tt><tt class="py-name">date</tt><tt class="py-op">)</tt> </tt>
<a name="L194"></a><tt class="py-lineno">194</tt>  <tt class="py-line">            <tt class="py-name">new_data</tt><tt class="py-op">.</tt><tt class="py-name">append</tt><tt class="py-op">(</tt><tt class="py-name">None</tt> <tt class="py-keyword">if</tt> <tt class="py-name">rec</tt> <tt class="py-keyword">is</tt> <tt class="py-name">None</tt> <tt class="py-keyword">else</tt> <tt class="py-name">getattr</tt><tt class="py-op">(</tt><tt class="py-name">rec</tt><tt class="py-op">,</tt> <tt class="py-name">attribute</tt><tt class="py-op">)</tt><tt class="py-op">)</tt> </tt>
<a name="L195"></a><tt class="py-lineno">195</tt>  <tt class="py-line">             </tt>
<a name="L196"></a><tt class="py-lineno">196</tt>  <tt class="py-line">            <tt class="py-comment"># increase by one day</tt> </tt>
<a name="L197"></a><tt class="py-lineno">197</tt>  <tt class="py-line">            <tt class="py-name">date</tt> <tt class="py-op">+=</tt> <tt class="py-name">datetime</tt><tt class="py-op">.</tt><tt class="py-name">timedelta</tt><tt class="py-op">(</tt><tt class="py-name">days</tt><tt class="py-op">=</tt><tt class="py-number">1</tt><tt class="py-op">)</tt> </tt>
<a name="L198"></a><tt class="py-lineno">198</tt>  <tt class="py-line">         </tt>
<a name="L199"></a><tt class="py-lineno">199</tt>  <tt class="py-line">        <tt class="py-keyword">return</tt> <tt class="py-name">new_data</tt> </tt>
</div><a name="L200"></a><tt class="py-lineno">200</tt>  <tt class="py-line">                    </tt>
<a name="L201"></a><tt class="py-lineno">201</tt>  <tt class="py-line">         </tt>
<a name="L202"></a><tt class="py-lineno">202</tt>  <tt class="py-line">    <tt class="py-comment">#--------------assign properties using get and set-methods-----------------</tt> </tt>
<a name="L203"></a><tt class="py-lineno">203</tt>  <tt class="py-line"> </tt>
<a name="L204"></a><tt class="py-lineno">204</tt>  <tt class="py-line">    <tt id="link-24" class="py-name" targets="Variable src.datastructure.interval_list.Interval_list.begintime=src.datastructure.interval_list.Interval_list-class.html#begintime,Variable src.datastructure.linkset.Linkset.begintime=src.datastructure.linkset.Linkset-class.html#begintime,Variable src.datastructure.record_list.Record_list.begintime=src.datastructure.record_list.Record_list-class.html#begintime"><a title="src.datastructure.interval_list.Interval_list.begintime
src.datastructure.linkset.Linkset.begintime
src.datastructure.record_list.Record_list.begintime" class="py-name" href="#" onclick="return doclink('link-24', 'begintime', 'link-24');">begintime</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-25" class="py-name" targets="Method src.datastructure.interval_list.Interval_list.get_begintime()=src.datastructure.interval_list.Interval_list-class.html#get_begintime,Method src.datastructure.linkset.Linkset.get_begintime()=src.datastructure.linkset.Linkset-class.html#get_begintime,Method src.datastructure.record_list.Record_list.get_begintime()=src.datastructure.record_list.Record_list-class.html#get_begintime"><a title="src.datastructure.interval_list.Interval_list.get_begintime
src.datastructure.linkset.Linkset.get_begintime
src.datastructure.record_list.Record_list.get_begintime" class="py-name" href="#" onclick="return doclink('link-25', 'get_begintime', 'link-25');">get_begintime</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"timestamp of the earliest record (calculated from input data)"</tt><tt class="py-op">)</tt> </tt>
<a name="L205"></a><tt class="py-lineno">205</tt>  <tt class="py-line">    <tt id="link-26" class="py-name"><a title="src.datastructure.interval_list.Interval_list.endtime
src.datastructure.linkset.Linkset.endtime
src.datastructure.record_list.Record_list.endtime" class="py-name" href="#" onclick="return doclink('link-26', 'endtime', 'link-22');">endtime</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-27" class="py-name" targets="Method src.datastructure.interval_list.Interval_list.get_endtime()=src.datastructure.interval_list.Interval_list-class.html#get_endtime,Method src.datastructure.linkset.Linkset.get_endtime()=src.datastructure.linkset.Linkset-class.html#get_endtime,Method src.datastructure.record_list.Record_list.get_endtime()=src.datastructure.record_list.Record_list-class.html#get_endtime"><a title="src.datastructure.interval_list.Interval_list.get_endtime
src.datastructure.linkset.Linkset.get_endtime
src.datastructure.record_list.Record_list.get_endtime" class="py-name" href="#" onclick="return doclink('link-27', 'get_endtime', 'link-27');">get_endtime</a></tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-name">None</tt><tt class="py-op">,</tt> <tt class="py-string">"timestamp of the most up-to-date-record (calculated from input data)"</tt><tt class="py-op">)</tt> </tt>
<a name="L206"></a><tt class="py-lineno">206</tt>  <tt class="py-line">    <tt id="link-28" class="py-name"><a title="src.datastructure.agg_record.Agg_record.interval
src.datastructure.interval_list.Interval_list.interval" class="py-name" href="#" onclick="return doclink('link-28', 'interval', 'link-3');">interval</a></tt> <tt class="py-op">=</tt> <tt class="py-name">property</tt><tt class="py-op">(</tt><tt id="link-29" class="py-name" targets="Method src.datastructure.agg_record.Agg_record.get_interval()=src.datastructure.agg_record.Agg_record-class.html#get_interval,Method src.datastructure.interval_list.Interval_list.get_interval()=src.datastructure.interval_list.Interval_list-class.html#get_interval"><a title="src.datastructure.agg_record.Agg_record.get_interval
src.datastructure.interval_list.Interval_list.get_interval" class="py-name" href="#" onclick="return doclink('link-29', 'get_interval', 'link-29');">get_interval</a></tt><tt class="py-op">,</tt> <tt id="link-30" class="py-name" targets="Method src.datastructure.agg_record.Agg_record.set_interval()=src.datastructure.agg_record.Agg_record-class.html#set_interval,Method src.datastructure.interval_list.Interval_list.set_interval()=src.datastructure.interval_list.Interval_list-class.html#set_interval"><a title="src.datastructure.agg_record.Agg_record.set_interval
src.datastructure.interval_list.Interval_list.set_interval" class="py-name" href="#" onclick="return doclink('link-30', 'set_interval', 'link-30');">set_interval</a></tt><tt class="py-op">,</tt> <tt id="link-31" class="py-name" targets="Method src.datastructure.agg_record.Agg_record.del_interval()=src.datastructure.agg_record.Agg_record-class.html#del_interval,Method src.datastructure.interval_list.Interval_list.del_interval()=src.datastructure.interval_list.Interval_list-class.html#del_interval"><a title="src.datastructure.agg_record.Agg_record.del_interval
src.datastructure.interval_list.Interval_list.del_interval" class="py-name" href="#" onclick="return doclink('link-31', 'del_interval', 'link-31');">del_interval</a></tt><tt class="py-op">,</tt> <tt class="py-string">"time interval"</tt><tt class="py-op">)</tt> </tt>
</div><a name="L207"></a><tt class="py-lineno">207</tt>  <tt class="py-line"> </tt><script type="text/javascript">
<!--
expandto(location.href);
// -->
</script>
</pre>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">
  <!-- Home link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="src-module.html">Home</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            >ttrq4fleet - Petrina Papazek</th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Thu Oct 25 19:15:44 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
